home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
ELECTRON
/
1009.ZIP
/
HAM2.ARC
/
GRCIRDIS.BAS
< prev
next >
Wrap
BASIC Source File
|
1979-12-31
|
6KB
|
156 lines
10 ' GREAT CIRCLE DISTANCE PROGRAM
11 ' LOCATED ON DISK OFFLIN-001 , FILESPEC IS: GRCIRDIS.BAS
12 CLS
30 PRINT "*******************************************************************"
31 PRINT "*******************************************************************"
40 PRINT
50 PRINT " GREAT CIRCLE DISTANCE"
60 PRINT
70 PRINT
75 PRINT "THIS PROGRAM WILL COMPUTE THE GREAT CIRCLE DISTANCE IN MILES AND IN"
80 PRINT "KILOMETERS BETWEEN ANY TWO POINTS FOR WHICH THE LATITUDE AND LONGI-"
85 PRINT "TUDE ARE GIVEN."
90 PRINT
95 PRINT "WHEN ENTERING LATITUDE AND LONGITUDE, THE DEGREES AND MINUTES FOR"
100 PRINT "SOUTH LATITUDE AND EAST LONGITUDE MUST BE ENTERED AS NEGATIVES."
105 PRINT
110 PRINT
115 PRINT "PRESS <RETURN> IF YOU ARE READY TO START ";
120 INPUT Z$
125 CLS
150 PRINT
155 PRINT "******************** REMEMBER ********************"
160 PRINT " __________"
162 PRINT
164 PRINT
166 PRINT
168 PRINT "#################################################################"
169 PRINT "#################################################################"
170 PRINT "### ###"
172 PRINT "### ###"
174 PRINT "### ###"
176 PRINT "### NORTH IS + SOUTH IS - ###"
178 PRINT "### WEST IS + EAST IS - ###"
180 PRINT "### ###"
182 PRINT "### ###"
184 PRINT "### ###"
186 PRINT "#################################################################"
188 PRINT "#################################################################"
190 PRINT
192 PRINT "THE ABOVE INFORMATION IS MOST IMPORTANT. IF YOU USE THE WRONG"
194 PRINT "SIGN, ALL CALCULATIONS WILL BE INCORRECT. ***********************"
196 PRINT
197 PRINT "PRESS <RETURN> TO CONTINUE -- OK ";
198 INPUT Z$
199 PRINT
440 CLS
445 PRINT "*****************************************************************"
450 PRINT
460 PRINT "PLEASE INPUT THE NAME OF POINT A ";
470 INPUT A$
490 PRINT
500 PRINT "ENTER DEGREES OF LATITUDE: ";
510 INPUT BD
530 PRINT "ENTER MINUTES OF LATITUDE: ";
540 INPUT BM
560 LET B=BD+(BM/60)
570 PRINT
580 PRINT "ENTER DEGREES OF LONGITUDE: ";
590 INPUT CD
610 PRINT "ENTER MINUTES OF LONGITUDE: ";
620 INPUT CM
640 LET C=CD+(CM/60)
650 PRINT
655 PRINT "-----------------------------------------------------------------"
656 PRINT
660 PRINT "PLEASE INPUT THE NAME OF POINT B ";
670 INPUT D$
690 PRINT
700 PRINT "ENTER DEGREES OF LATITUDE: ";
710 INPUT ED
730 PRINT "ENTER MINUTES OF LATITUDE: ";
740 INPUT EM
760 LET E=ED+(EM/60)
770 PRINT
780 PRINT "ENTER DEGREES OF LONGITUDE: ";
790 INPUT FD
800 PRINT "ENTER MINUTES OF LONGITUDE: ";
810 INPUT FM
832 PRINT
836 PRINT "******************************************************************"
840 LET F=FD+(FM/60)
842 FOR Z=1 TO 5500
845 NEXT Z
850 CLS
860 LET G=(90-B)/180*3.14159265#
870 LET K=ABS (C-F)
880 LET L=(90-E)/180*3.14159265#
890 LET N=(G+L)/2
900 LET P=(G-L)/2
910 LET Q=(K/2)/180*3.14159265#
920 LET R=ATN (((COS (Q)/SIN (Q))*(COS (P))/COS (N)))
930 LET S=ATN ((COS (Q)/SIN (Q))*SIN (P)/SIN (N))
940 LET T=ATN ((SIN (P)/COS (P))*SIN (R)/SIN (S))
970 LET J=(2*T)/3.14159265#*180
980 LET U=INT ((J*69.113)+.5)
990 IF U<0 THEN LET U=U*(-1)
1000 PRINT "*****************************************************************"
1005 PRINT "*****************************************************************"
1010 LPRINT "*****************************************************************"
1020 LPRINT "*****************************************************************"
1021 PRINT
1022 PRINT
1023 LPRINT
1024 LPRINT
1025 PRINT A$
1026 LPRINT A$
1030 LPRINT " LATITUDE: ";INT (B*1000)/1000;" DEGREES"
1032 PRINT " LATITUDE: ";INT (B*1000)/1000;" DEGREES"
1040 PRINT " LONGITUDE: ";INT (C*1000)/1000;" DEGREES"
1042 LPRINT " LONGITUDE: ";INT (C*1000)/1000;" DEGREES"
1050 PRINT
1052 LPRINT
1060 PRINT D$
1062 LPRINT D$
1070 PRINT " LATITUDE: ";INT (E*1000)/1000;" DEGREES"
1072 LPRINT " LATITUDE: ";INT (E*1000)/1000;" DEGREES"
1080 PRINT " LONGITUDE: ";INT (F*1000)/1000;" DEGREES"
1082 LPRINT " LONGITUDE: ";INT (F*1000)/1000;" DEGREES"
1090 PRINT
1092 LPRINT
1094 PRINT "-----------------------------------------------------------------"
1096 LPRINT "-----------------------------------------------------------------"
1100 PRINT
1102 LPRINT
1110 PRINT "THE DISTANCE FROM"
1111 LPRINT "THE DISTANCE FROM"
1112 PRINT A$;" TO"
1113 LPRINT A$;" TO"
1114 PRINT D$;" IS:"
1115 LPRINT D$;" IS:"
1130 PRINT U;" MILES OR ";INT (U*6336/3937);" KILOMETERS"
1132 LPRINT U;" MILES OR ";INT (U*6336/3937);" KILOMETERS"
1140 PRINT
1142 LPRINT
1150 PRINT "*****************************************************************"
1152 LPRINT "*****************************************************************"
1154 PRINT
1156 LPRINT
1160 PRINT "ANOTHER CASE (Y/N) ";
1162 INPUT H$
1164 PRINT
1166 LPRINT
1170 IF H$="Y" THEN GOTO 440
1172 IF H$="N" THEN GOTO 1200
1174 GOTO 1162
1200 CLS
1202 PRINT "////////////////////////////////////////////////////////////////"
1204 PRINT
1206 PRINT "THIS PROGRAM HAS ENDED *****************************************"
1208 PRINT
1210 PRINT
1220 PRINT
1230 PRINT
1240 PRINT
1250 PRINT